/* OUTPUT TO c:\qadguicli\doc\prd_lbr_zero.xls. */

DEFINE BUFFER c FOR sct_det.
DEFINE BUFFER s FOR sct_det.

FOR EACH c WHERE c.sct_lbr_tl <> 0 AND c.sct_sim = "standard" AND c.sct_site = "500",
    EACH pt_mstr WHERE pt_part = c.sct_part AND pt_part_type = "FG-A" AND pt_status = "AC"
    BY pt_group BY pt_part :

    IF pt_bom_code <> "" THEN
       FIND FIRST s WHERE s.sct_part = pt_bom_code AND s.sct_sim = "standard" AND s.sct_site = "500" NO-LOCK NO-ERROR.

    DISP pt_group pt_part pt_part_type pt_status pt_pm_code 
         c.sct_cst_tot 
         c.sct_lbr_tl 
         (c.sct_sub_ll + c.sct_sub_tl + c.sct_bdn_ll + c.sct_bdn_tl)
         pt_bom_code 
         s.sct_cst_tot WHEN (AVAILABLE s)
         s.sct_lbr_tl WHEN (AVAILABLE s)
         pt_desc1
        WITH STREAM-IO WIDTH 200.
END.
